1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module sourceview.PrintCompositor;
26 
27 private import glib.ConstructionException;
28 private import glib.Str;
29 private import glib.c.functions;
30 private import gobject.ObjectG;
31 private import gtk.PrintContext;
32 private import gtk.TextTag;
33 private import sourceview.Buffer;
34 private import sourceview.View;
35 private import sourceview.c.functions;
36 public  import sourceview.c.types;
37 
38 
39 /**
40  * Compose a [class@Buffer] for printing.
41  * 
42  * The `GtkSourcePrintCompositor` object is used to compose a [class@Buffer]
43  * for printing. You can set various configuration options to customize the
44  * printed output. `GtkSourcePrintCompositor` is designed to be used with the
45  * high-level printing API of gtk+, i.e. [class@Gtk.PrintOperation].
46  * 
47  * The margins specified in this object are the layout margins: they define the
48  * blank space bordering the printed area of the pages. They must not be
49  * confused with the "print margins", i.e. the parts of the page that the
50  * printer cannot print on, defined in the [class@Gtk.PageSetup] objects. If the
51  * specified layout margins are smaller than the "print margins", the latter
52  * ones are used as a fallback by the `GtkSourcePrintCompositor` object, so that
53  * the printed area is not clipped.
54  */
55 public class PrintCompositor : ObjectG
56 {
57 	/** the main Gtk struct */
58 	protected GtkSourcePrintCompositor* gtkSourcePrintCompositor;
59 
60 	/** Get the main Gtk struct */
61 	public GtkSourcePrintCompositor* getPrintCompositorStruct(bool transferOwnership = false)
62 	{
63 		if (transferOwnership)
64 			ownedRef = false;
65 		return gtkSourcePrintCompositor;
66 	}
67 
68 	/** the main Gtk struct as a void* */
69 	protected override void* getStruct()
70 	{
71 		return cast(void*)gtkSourcePrintCompositor;
72 	}
73 
74 	/**
75 	 * Sets our main struct and passes it to the parent class.
76 	 */
77 	public this (GtkSourcePrintCompositor* gtkSourcePrintCompositor, bool ownedRef = false)
78 	{
79 		this.gtkSourcePrintCompositor = gtkSourcePrintCompositor;
80 		super(cast(GObject*)gtkSourcePrintCompositor, ownedRef);
81 	}
82 
83 
84 	/** */
85 	public static GType getType()
86 	{
87 		return gtk_source_print_compositor_get_type();
88 	}
89 
90 	/**
91 	 * Creates a new print compositor that can be used to print @buffer.
92 	 *
93 	 * Params:
94 	 *     buffer = the #GtkSourceBuffer to print.
95 	 *
96 	 * Returns: a new print compositor object.
97 	 *
98 	 * Throws: ConstructionException GTK+ fails to create the object.
99 	 */
100 	public this(Buffer buffer)
101 	{
102 		auto __p = gtk_source_print_compositor_new((buffer is null) ? null : buffer.getBufferStruct());
103 
104 		if(__p is null)
105 		{
106 			throw new ConstructionException("null returned by new");
107 		}
108 
109 		this(cast(GtkSourcePrintCompositor*) __p, true);
110 	}
111 
112 	/**
113 	 * Creates a new print compositor that can be used to print the buffer
114 	 * associated with @view.
115 	 *
116 	 * This constructor sets some configuration properties to make the
117 	 * printed output match @view as much as possible.  The properties set are
118 	 * [property@PrintCompositor:tab-width], [property@PrintCompositor:highlight-syntax],
119 	 * [property@PrintCompositor:wrap-mode], [property@PrintCompositor:body-font-name] and
120 	 * [property@PrintCompositor:print-line-numbers].
121 	 *
122 	 * Params:
123 	 *     view = a #GtkSourceView to get configuration from.
124 	 *
125 	 * Returns: a new print compositor object.
126 	 *
127 	 * Throws: ConstructionException GTK+ fails to create the object.
128 	 */
129 	public this(View view)
130 	{
131 		auto __p = gtk_source_print_compositor_new_from_view((view is null) ? null : view.getViewStruct());
132 
133 		if(__p is null)
134 		{
135 			throw new ConstructionException("null returned by new_from_view");
136 		}
137 
138 		this(cast(GtkSourcePrintCompositor*) __p, true);
139 	}
140 
141 	/**
142 	 * Draw page @page_nr for printing on the the Cairo context encapsuled in @context.
143 	 *
144 	 * This method has been designed to be called in the handler of the [signal@Gtk.PrintOperation::draw_page] signal
145 	 * as shown in the following example:
146 	 *
147 	 * ```c
148 	 * // Signal handler for the GtkPrintOperation::draw_page signal
149 	 *
150 	 * static void
151 	 * draw_page (GtkPrintOperation *operation,
152 	 * GtkPrintContext   *context,
153 	 * gint               page_nr,
154 	 * gpointer           user_data)
155 	 * {
156 	 * GtkSourcePrintCompositor *compositor;
157 	 *
158 	 * compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);
159 	 *
160 	 * gtk_source_print_compositor_draw_page (compositor,
161 	 * context,
162 	 * page_nr);
163 	 * }
164 	 * ```
165 	 *
166 	 * Params:
167 	 *     context = the #GtkPrintContext encapsulating the context information that is required when
168 	 *         drawing the page for printing.
169 	 *     pageNr = the number of the page to print.
170 	 */
171 	public void drawPage(PrintContext context, int pageNr)
172 	{
173 		gtk_source_print_compositor_draw_page(gtkSourcePrintCompositor, (context is null) ? null : context.getPrintContextStruct(), pageNr);
174 	}
175 
176 	/**
177 	 * Returns the name of the font used to print the text body.
178 	 *
179 	 * The returned string must be freed with g_free().
180 	 *
181 	 * Returns: a new string containing the name of the font used to print the
182 	 *     text body.
183 	 */
184 	public string getBodyFontName()
185 	{
186 		auto retStr = gtk_source_print_compositor_get_body_font_name(gtkSourcePrintCompositor);
187 
188 		scope(exit) Str.freeString(retStr);
189 		return Str.toString(retStr);
190 	}
191 
192 	/**
193 	 * Gets the bottom margin in units of @unit.
194 	 *
195 	 * Params:
196 	 *     unit = the unit for the return value.
197 	 *
198 	 * Returns: the bottom margin.
199 	 */
200 	public double getBottomMargin(GtkUnit unit)
201 	{
202 		return gtk_source_print_compositor_get_bottom_margin(gtkSourcePrintCompositor, unit);
203 	}
204 
205 	/**
206 	 * Gets the [class@Buffer] associated with the compositor.
207 	 *
208 	 * The returned object reference is owned by the compositor object and
209 	 * should not be unreferenced.
210 	 *
211 	 * Returns: the #GtkSourceBuffer associated with the compositor.
212 	 */
213 	public Buffer getBuffer()
214 	{
215 		auto __p = gtk_source_print_compositor_get_buffer(gtkSourcePrintCompositor);
216 
217 		if(__p is null)
218 		{
219 			return null;
220 		}
221 
222 		return ObjectG.getDObject!(Buffer)(cast(GtkSourceBuffer*) __p);
223 	}
224 
225 	/**
226 	 * Returns the name of the font used to print the page footer.
227 	 *
228 	 * The returned string must be freed with g_free().
229 	 *
230 	 * Returns: a new string containing the name of the font used to print
231 	 *     the page footer.
232 	 */
233 	public string getFooterFontName()
234 	{
235 		auto retStr = gtk_source_print_compositor_get_footer_font_name(gtkSourcePrintCompositor);
236 
237 		scope(exit) Str.freeString(retStr);
238 		return Str.toString(retStr);
239 	}
240 
241 	/**
242 	 * Returns the name of the font used to print the page header.
243 	 *
244 	 * The returned string must be freed with g_free().
245 	 *
246 	 * Returns: a new string containing the name of the font used to print
247 	 *     the page header.
248 	 */
249 	public string getHeaderFontName()
250 	{
251 		auto retStr = gtk_source_print_compositor_get_header_font_name(gtkSourcePrintCompositor);
252 
253 		scope(exit) Str.freeString(retStr);
254 		return Str.toString(retStr);
255 	}
256 
257 	/**
258 	 * Determines whether the printed text will be highlighted according to the
259 	 * buffer rules.
260 	 *
261 	 * Note that highlighting will happen only if the buffer to print has highlighting activated.
262 	 *
263 	 * Returns: %TRUE if the printed output will be highlighted.
264 	 */
265 	public bool getHighlightSyntax()
266 	{
267 		return gtk_source_print_compositor_get_highlight_syntax(gtkSourcePrintCompositor) != 0;
268 	}
269 
270 	/**
271 	 * Gets the left margin in units of @unit.
272 	 *
273 	 * Params:
274 	 *     unit = the unit for the return value.
275 	 *
276 	 * Returns: the left margin
277 	 */
278 	public double getLeftMargin(GtkUnit unit)
279 	{
280 		return gtk_source_print_compositor_get_left_margin(gtkSourcePrintCompositor, unit);
281 	}
282 
283 	/**
284 	 * Returns the name of the font used to print line numbers on the left margin.
285 	 *
286 	 * The returned string must be freed with g_free().
287 	 *
288 	 * Returns: a new string containing the name of the font used to print
289 	 *     line numbers on the left margin.
290 	 */
291 	public string getLineNumbersFontName()
292 	{
293 		auto retStr = gtk_source_print_compositor_get_line_numbers_font_name(gtkSourcePrintCompositor);
294 
295 		scope(exit) Str.freeString(retStr);
296 		return Str.toString(retStr);
297 	}
298 
299 	/**
300 	 * Returns the number of pages in the document or <code>-1</code> if the
301 	 * document has not been completely paginated.
302 	 *
303 	 * Returns: the number of pages in the document or <code>-1</code> if the
304 	 *     document has not been completely paginated.
305 	 */
306 	public int getNPages()
307 	{
308 		return gtk_source_print_compositor_get_n_pages(gtkSourcePrintCompositor);
309 	}
310 
311 	/**
312 	 * Returns the current fraction of the document pagination that has been completed.
313 	 *
314 	 * Returns: a fraction from 0.0 to 1.0 inclusive.
315 	 */
316 	public double getPaginationProgress()
317 	{
318 		return gtk_source_print_compositor_get_pagination_progress(gtkSourcePrintCompositor);
319 	}
320 
321 	/**
322 	 * Determines if a footer is set to be printed for each page.
323 	 *
324 	 * A footer will be printed if this function returns %TRUE
325 	 * **and** some format strings have been specified
326 	 * with [method@PrintCompositor.set_footer_format].
327 	 *
328 	 * Returns: %TRUE if the footer is set to be printed.
329 	 */
330 	public bool getPrintFooter()
331 	{
332 		return gtk_source_print_compositor_get_print_footer(gtkSourcePrintCompositor) != 0;
333 	}
334 
335 	/**
336 	 * Determines if a header is set to be printed for each page.
337 	 *
338 	 * A header will be printed if this function returns %TRUE
339 	 * **and** some format strings have been specified
340 	 * with [method@PrintCompositor.set_header_format].
341 	 *
342 	 * Returns: %TRUE if the header is set to be printed.
343 	 */
344 	public bool getPrintHeader()
345 	{
346 		return gtk_source_print_compositor_get_print_header(gtkSourcePrintCompositor) != 0;
347 	}
348 
349 	/**
350 	 * Returns the interval used for line number printing.
351 	 *
352 	 * If the value is 0, no line numbers will be printed. The default value is
353 	 * 1 (i.e. numbers printed in all lines).
354 	 *
355 	 * Returns: the interval of printed line numbers.
356 	 */
357 	public uint getPrintLineNumbers()
358 	{
359 		return gtk_source_print_compositor_get_print_line_numbers(gtkSourcePrintCompositor);
360 	}
361 
362 	/**
363 	 * Gets the right margin in units of @unit.
364 	 *
365 	 * Params:
366 	 *     unit = the unit for the return value.
367 	 *
368 	 * Returns: the right margin.
369 	 */
370 	public double getRightMargin(GtkUnit unit)
371 	{
372 		return gtk_source_print_compositor_get_right_margin(gtkSourcePrintCompositor, unit);
373 	}
374 
375 	/**
376 	 * Returns the width of tabulation in characters for printed text.
377 	 *
378 	 * Returns: width of tab.
379 	 */
380 	public uint getTabWidth()
381 	{
382 		return gtk_source_print_compositor_get_tab_width(gtkSourcePrintCompositor);
383 	}
384 
385 	/**
386 	 * Gets the top margin in units of @unit.
387 	 *
388 	 * Params:
389 	 *     unit = the unit for the return value.
390 	 *
391 	 * Returns: the top margin.
392 	 */
393 	public double getTopMargin(GtkUnit unit)
394 	{
395 		return gtk_source_print_compositor_get_top_margin(gtkSourcePrintCompositor, unit);
396 	}
397 
398 	/**
399 	 * Gets the line wrapping mode for the printed text.
400 	 *
401 	 * Returns: the line wrap mode.
402 	 */
403 	public GtkWrapMode getWrapMode()
404 	{
405 		return gtk_source_print_compositor_get_wrap_mode(gtkSourcePrintCompositor);
406 	}
407 
408 	/**
409 	 * Specifies a tag whose style should be ignored when compositing the
410 	 * document to the printable page.
411 	 *
412 	 * Params:
413 	 *     tag = a #GtkTextTag
414 	 *
415 	 * Since: 5.2
416 	 */
417 	public void ignoreTag(TextTag tag)
418 	{
419 		gtk_source_print_compositor_ignore_tag(gtkSourcePrintCompositor, (tag is null) ? null : tag.getTextTagStruct());
420 	}
421 
422 	/**
423 	 * Paginate the document associated with the @compositor.
424 	 *
425 	 * In order to support non-blocking pagination, document is paginated in small chunks.
426 	 * Each time [method@PrintCompositor.paginate] is invoked, a chunk of the document
427 	 * is paginated. To paginate the entire document, [method@PrintCompositor.paginate]
428 	 * must be invoked multiple times.
429 	 * It returns %TRUE if the document has been completely paginated, otherwise it returns %FALSE.
430 	 *
431 	 * This method has been designed to be invoked in the handler of the [signal@Gtk.PrintOperation::paginate] signal,
432 	 * as shown in the following example:
433 	 *
434 	 * ```c
435 	 * // Signal handler for the GtkPrintOperation::paginate signal
436 	 *
437 	 * static gboolean
438 	 * paginate (GtkPrintOperation *operation,
439 	 * GtkPrintContext   *context,
440 	 * gpointer           user_data)
441 	 * {
442 	 * GtkSourcePrintCompositor *compositor;
443 	 *
444 	 * compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);
445 	 *
446 	 * if (gtk_source_print_compositor_paginate (compositor, context))
447 	 * {
448 	 * gint n_pages;
449 	 *
450 	 * n_pages = gtk_source_print_compositor_get_n_pages (compositor);
451 	 * gtk_print_operation_set_n_pages (operation, n_pages);
452 	 *
453 	 * return TRUE;
454 	 * }
455 	 *
456 	 * return FALSE;
457 	 * }
458 	 * ```
459 	 *
460 	 * If you don't need to do pagination in chunks, you can simply do it all in the
461 	 * [signal@Gtk.PrintOperation::begin-print] handler, and set the number of pages from there, like
462 	 * in the following example:
463 	 *
464 	 * ```c
465 	 * // Signal handler for the GtkPrintOperation::begin-print signal
466 	 *
467 	 * static void
468 	 * begin_print (GtkPrintOperation *operation,
469 	 * GtkPrintContext   *context,
470 	 * gpointer           user_data)
471 	 * {
472 	 * GtkSourcePrintCompositor *compositor;
473 	 * gint n_pages;
474 	 *
475 	 * compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);
476 	 *
477 	 * while (!gtk_source_print_compositor_paginate (compositor, context));
478 	 *
479 	 * n_pages = gtk_source_print_compositor_get_n_pages (compositor);
480 	 * gtk_print_operation_set_n_pages (operation, n_pages);
481 	 * }
482 	 * ```
483 	 *
484 	 * Params:
485 	 *     context = the #GtkPrintContext whose parameters (e.g. paper size, print margins, etc.)
486 	 *         are used by the the @compositor to paginate the document.
487 	 *
488 	 * Returns: %TRUE if the document has been completely paginated, %FALSE otherwise.
489 	 */
490 	public bool paginate(PrintContext context)
491 	{
492 		return gtk_source_print_compositor_paginate(gtkSourcePrintCompositor, (context is null) ? null : context.getPrintContextStruct()) != 0;
493 	}
494 
495 	/**
496 	 * Sets the default font for the printed text.
497 	 *
498 	 * @font_name should be a
499 	 * string representation of a font description Pango can understand.
500 	 * (e.g. &quot;Monospace 10&quot;). See [func@Pango.FontDescription.from_string]
501 	 * for a description of the format of the string representation.
502 	 *
503 	 * This function cannot be called anymore after the first call to the
504 	 * [method@PrintCompositor.paginate] function.
505 	 *
506 	 * Params:
507 	 *     fontName = the name of the default font for the body text.
508 	 */
509 	public void setBodyFontName(string fontName)
510 	{
511 		gtk_source_print_compositor_set_body_font_name(gtkSourcePrintCompositor, Str.toStringz(fontName));
512 	}
513 
514 	/**
515 	 * Sets the bottom margin used by @compositor.
516 	 *
517 	 * Params:
518 	 *     margin = the new bottom margin in units of @unit.
519 	 *     unit = the units for @margin.
520 	 */
521 	public void setBottomMargin(double margin, GtkUnit unit)
522 	{
523 		gtk_source_print_compositor_set_bottom_margin(gtkSourcePrintCompositor, margin, unit);
524 	}
525 
526 	/**
527 	 * Sets the font for printing the page footer.
528 	 *
529 	 * If %NULL is supplied, the default font (i.e. the one being used for the
530 	 * text) will be used instead.
531 	 *
532 	 * @font_name should be a
533 	 * string representation of a font description Pango can understand.
534 	 * (e.g. &quot;Monospace 10&quot;). See [func@Pango.FontDescription.from_string]
535 	 * for a description of the format of the string representation.
536 	 *
537 	 * This function cannot be called anymore after the first call to the
538 	 * [method@PrintCompositor.paginate] function.
539 	 *
540 	 * Params:
541 	 *     fontName = the name of the font for the footer text, or %NULL.
542 	 */
543 	public void setFooterFontName(string fontName)
544 	{
545 		gtk_source_print_compositor_set_footer_font_name(gtkSourcePrintCompositor, Str.toStringz(fontName));
546 	}
547 
548 	/**
549 	 * See [method@PrintCompositor.set_header_format] for more information
550 	 * about the parameters.
551 	 *
552 	 * Params:
553 	 *     separator = %TRUE if you want a separator line to be printed.
554 	 *     left = a format string to print on the left of the footer.
555 	 *     center = a format string to print on the center of the footer.
556 	 *     right = a format string to print on the right of the footer.
557 	 */
558 	public void setFooterFormat(bool separator, string left, string center, string right)
559 	{
560 		gtk_source_print_compositor_set_footer_format(gtkSourcePrintCompositor, separator, Str.toStringz(left), Str.toStringz(center), Str.toStringz(right));
561 	}
562 
563 	/**
564 	 * Sets the font for printing the page header.
565 	 *
566 	 * If %NULL is supplied, the default font (i.e. the one being used for the
567 	 * text) will be used instead.
568 	 *
569 	 * @font_name should be a
570 	 * string representation of a font description Pango can understand.
571 	 * (e.g. &quot;Monospace 10&quot;). See [func@Pango.FontDescription.from_string]
572 	 * for a description of the format of the string representation.
573 	 *
574 	 * This function cannot be called anymore after the first call to the
575 	 * [method@PrintCompositor.paginate] function.
576 	 *
577 	 * Params:
578 	 *     fontName = the name of the font for header text, or %NULL.
579 	 */
580 	public void setHeaderFontName(string fontName)
581 	{
582 		gtk_source_print_compositor_set_header_font_name(gtkSourcePrintCompositor, Str.toStringz(fontName));
583 	}
584 
585 	/**
586 	 * Sets strftime like header format strings, to be printed on the
587 	 * left, center and right of the top of each page.
588 	 *
589 	 * The strings may include strftime(3) codes which will be expanded at print time.
590 	 * A subset of strftime() codes are accepted, see [method@GLib.DateTime.format]
591 	 * for more details on the accepted format specifiers.
592 	 * Additionally the following format specifiers are accepted:
593 	 *
594 	 * - #N: the page number
595 	 * - #Q: the page count.
596 	 *
597 	 * @separator specifies if a solid line should be drawn to separate
598 	 * the header from the document text.
599 	 *
600 	 * If %NULL is given for any of the three arguments, that particular
601 	 * string will not be printed.
602 	 *
603 	 * For the header to be printed, in
604 	 * addition to specifying format strings, you need to enable header
605 	 * printing with [method@PrintCompositor.set_print_header].
606 	 *
607 	 * This function cannot be called anymore after the first call to the
608 	 * [method@PrintCompositor.paginate] function.
609 	 *
610 	 * Params:
611 	 *     separator = %TRUE if you want a separator line to be printed.
612 	 *     left = a format string to print on the left of the header.
613 	 *     center = a format string to print on the center of the header.
614 	 *     right = a format string to print on the right of the header.
615 	 */
616 	public void setHeaderFormat(bool separator, string left, string center, string right)
617 	{
618 		gtk_source_print_compositor_set_header_format(gtkSourcePrintCompositor, separator, Str.toStringz(left), Str.toStringz(center), Str.toStringz(right));
619 	}
620 
621 	/**
622 	 * Sets whether the printed text will be highlighted according to the
623 	 * buffer rules.  Both color and font style are applied.
624 	 *
625 	 * This function cannot be called anymore after the first call to the
626 	 * [method@PrintCompositor.paginate] function.
627 	 *
628 	 * Params:
629 	 *     highlight = whether syntax should be highlighted.
630 	 */
631 	public void setHighlightSyntax(bool highlight)
632 	{
633 		gtk_source_print_compositor_set_highlight_syntax(gtkSourcePrintCompositor, highlight);
634 	}
635 
636 	/**
637 	 * Sets the left margin used by @compositor.
638 	 *
639 	 * Params:
640 	 *     margin = the new left margin in units of @unit.
641 	 *     unit = the units for @margin.
642 	 */
643 	public void setLeftMargin(double margin, GtkUnit unit)
644 	{
645 		gtk_source_print_compositor_set_left_margin(gtkSourcePrintCompositor, margin, unit);
646 	}
647 
648 	/**
649 	 * Sets the font for printing line numbers on the left margin.
650 	 *
651 	 * If %NULL is supplied, the default font (i.e. the one being used for the
652 	 * text) will be used instead.
653 	 *
654 	 * @font_name should be a
655 	 * string representation of a font description Pango can understand.
656 	 * (e.g. &quot;Monospace 10&quot;). See [func@Pango.FontDescription.from_string]
657 	 * for a description of the format of the string representation.
658 	 *
659 	 * This function cannot be called anymore after the first call to the
660 	 * [method@PrintCompositor.paginate] function.
661 	 *
662 	 * Params:
663 	 *     fontName = the name of the font for line numbers, or %NULL.
664 	 */
665 	public void setLineNumbersFontName(string fontName)
666 	{
667 		gtk_source_print_compositor_set_line_numbers_font_name(gtkSourcePrintCompositor, Str.toStringz(fontName));
668 	}
669 
670 	/**
671 	 * Sets whether you want to print a footer in each page.
672 	 *
673 	 * The footer consists of three pieces of text and an optional line
674 	 * separator, configurable with
675 	 * [method@PrintCompositor.set_footer_format].
676 	 *
677 	 * Note that by default the footer format is unspecified, and if it's
678 	 * empty it will not be printed, regardless of this setting.
679 	 *
680 	 * This function cannot be called anymore after the first call to the
681 	 * [method@PrintCompositor.paginate] function.
682 	 *
683 	 * Params:
684 	 *     print = %TRUE if you want the footer to be printed.
685 	 */
686 	public void setPrintFooter(bool print)
687 	{
688 		gtk_source_print_compositor_set_print_footer(gtkSourcePrintCompositor, print);
689 	}
690 
691 	/**
692 	 * Sets whether you want to print a header in each page.
693 	 *
694 	 * The header consists of three pieces of text and an optional line
695 	 * separator, configurable with [method@PrintCompositor.set_header_format].
696 	 *
697 	 * Note that by default the header format is unspecified, and if it's
698 	 * empty it will not be printed, regardless of this setting.
699 	 *
700 	 * This function cannot be called anymore after the first call to the
701 	 * [method@PrintCompositor.paginate] function.
702 	 *
703 	 * Params:
704 	 *     print = %TRUE if you want the header to be printed.
705 	 */
706 	public void setPrintHeader(bool print)
707 	{
708 		gtk_source_print_compositor_set_print_header(gtkSourcePrintCompositor, print);
709 	}
710 
711 	/**
712 	 * Sets the interval for printed line numbers.
713 	 *
714 	 * If @interval is 0 no numbers will be printed. If greater than 0, a number will be
715 	 * printed every @interval lines (i.e. 1 will print all line numbers).
716 	 *
717 	 * Maximum accepted value for @interval is 100.
718 	 *
719 	 * This function cannot be called anymore after the first call to the
720 	 * [method@PrintCompositor.paginate] function.
721 	 *
722 	 * Params:
723 	 *     interval = interval for printed line numbers.
724 	 */
725 	public void setPrintLineNumbers(uint interval)
726 	{
727 		gtk_source_print_compositor_set_print_line_numbers(gtkSourcePrintCompositor, interval);
728 	}
729 
730 	/**
731 	 * Sets the right margin used by @compositor.
732 	 *
733 	 * Params:
734 	 *     margin = the new right margin in units of @unit.
735 	 *     unit = the units for @margin.
736 	 */
737 	public void setRightMargin(double margin, GtkUnit unit)
738 	{
739 		gtk_source_print_compositor_set_right_margin(gtkSourcePrintCompositor, margin, unit);
740 	}
741 
742 	/**
743 	 * Sets the width of tabulation in characters for printed text.
744 	 *
745 	 * This function cannot be called anymore after the first call to the
746 	 * [method@PrintCompositor.paginate] function.
747 	 *
748 	 * Params:
749 	 *     width = width of tab in characters.
750 	 */
751 	public void setTabWidth(uint width)
752 	{
753 		gtk_source_print_compositor_set_tab_width(gtkSourcePrintCompositor, width);
754 	}
755 
756 	/**
757 	 * Sets the top margin used by @compositor.
758 	 *
759 	 * Params:
760 	 *     margin = the new top margin in units of @unit
761 	 *     unit = the units for @margin
762 	 */
763 	public void setTopMargin(double margin, GtkUnit unit)
764 	{
765 		gtk_source_print_compositor_set_top_margin(gtkSourcePrintCompositor, margin, unit);
766 	}
767 
768 	/**
769 	 * Sets the line wrapping mode for the printed text.
770 	 *
771 	 * This function cannot be called anymore after the first call to the
772 	 * [method@PrintCompositor.paginate] function.
773 	 *
774 	 * Params:
775 	 *     wrapMode = a #GtkWrapMode.
776 	 */
777 	public void setWrapMode(GtkWrapMode wrapMode)
778 	{
779 		gtk_source_print_compositor_set_wrap_mode(gtkSourcePrintCompositor, wrapMode);
780 	}
781 }